from urllib.parse import urlencode

params = {
    'name' : 'guohongjun',
    'age' : 12
}

base_url = 'http://www.baidu.com?'
url = base_url + urlencode(params)
print(url)